import { UpdateDependencies } from '@po-ui/ng-schematics/package-config';

//regex para remover po-icon
const regexRemovePoIconInside = new RegExp('(?<=\\s|^)po-icon(?=\\s|$)', 'gmi');
const regexRemovePoIcon = new RegExp('(?<!<)po-icon(?=\\s|$|"|\')', 'gmi');

export const iconsReplaced: Array<ReplaceChanges> = [
  { replace: 'po-icon-a11y-elderly', replaceWith: 'ph-elderly' },
  { replace: 'po-icon-a11y-pregnant', replaceWith: 'ph-pregnant' },
  { replace: 'po-icon-a11y-wheelchair', replaceWith: 'ph-wheelchair' },
  { replace: 'po-icon-agro-business', replaceWith: 'ph-plant' },
  { replace: 'po-icon-align-center', replaceWith: 'ph-text-align-center' },
  { replace: 'po-icon-align-justify', replaceWith: 'ph-text-align-justify' },
  { replace: 'po-icon-align-left', replaceWith: 'ph-text-align-left' },
  { replace: 'po-icon-align-right', replaceWith: 'ph-text-align-right' },
  { replace: 'po-icon-anchor', replaceWith: 'ph-anchor' },
  { replace: 'po-icon-archive', replaceWith: 'ph-archive' },
  { replace: 'po-icon-arrow-down', replaceWith: 'ph-caret-down' },
  { replace: 'po-icon-arrow-left', replaceWith: 'ph-caret-left' },
  { replace: 'po-icon-arrow-right', replaceWith: 'ph-caret-right' },
  { replace: 'po-icon-arrow-up', replaceWith: 'ph-caret-up' },
  { replace: 'po-icon-attach', replaceWith: 'ph-paperclip' },
  { replace: 'po-icon-automatic-barrier', replaceWith: 'ph-automatic-barrier' },
  { replace: 'po-icon-balance', replaceWith: 'ph-scales' },
  { replace: 'po-icon-balance-weight', replaceWith: 'ph-balance-weight' },
  { replace: 'po-icon-bar-code', replaceWith: 'ph-barcode' },
  { replace: 'po-icon-basket', replaceWith: 'ph-basket' },
  { replace: 'po-icon-bluetooth', replaceWith: 'ph-bluetooth' },
  { replace: 'po-icon-book', replaceWith: 'ph-book-bookmark' },
  { replace: 'po-icon-calculator', replaceWith: 'ph-calculator' },
  { replace: 'po-icon-calendar', replaceWith: 'ph-calendar-dots' },
  { replace: 'po-icon-calendar-ok', replaceWith: 'ph-calendar-check' },
  { replace: 'po-icon-calendar-settings', replaceWith: 'ph-calendar-gear' },
  { replace: 'po-icon-camera', replaceWith: 'ph-camera' },
  { replace: 'po-icon-cart', replaceWith: 'ph-shopping-cart-simple' },
  { replace: 'po-icon-change', replaceWith: 'ph-swap' },
  { replace: 'po-icon-chart-area', replaceWith: 'ph-chart-line' },
  { replace: 'po-icon-chart-columns', replaceWith: 'ph-chart-bar' },
  { replace: 'po-icon-chat', replaceWith: 'ph-chats' },
  { replace: 'po-icon-clear-content', replaceWith: 'ph-fill ph-x-circle', fill: true },
  { replace: 'po-icon-clipboard', replaceWith: 'ph-clipboard' },
  { replace: 'po-icon-clock', replaceWith: 'ph-clock' },
  { replace: 'po-icon-close', replaceWith: 'ph-x' },
  { replace: 'po-icon-company', replaceWith: 'ph-building-apartment' },
  { replace: 'po-icon-construction', replaceWith: 'ph-hard-hat' },
  { replace: 'po-icon-copy', replaceWith: 'ph-copy' },
  { replace: 'po-icon-cotton', replaceWith: 'ph-cotton' },
  { replace: 'po-icon-credit-payment', replaceWith: 'ph-credit-card' },
  { replace: 'po-icon-cut', replaceWith: 'ph-selection-background' },
  { replace: 'po-icon-database', replaceWith: 'ph-database' },
  { replace: 'po-icon-debit-payment', replaceWith: 'ph-debit-card' },
  { replace: 'po-icon-delete', replaceWith: 'ph-trash' },
  { replace: 'po-icon-device-desktop', replaceWith: 'ph-monitor' },
  { replace: 'po-icon-device-notebook', replaceWith: 'ph-laptop' },
  { replace: 'po-icon-device-smartphone', replaceWith: 'ph-device-mobile' },
  { replace: 'po-icon-device-tablet', replaceWith: 'ph-device-tablet-speaker' },
  { replace: 'po-icon-doc-xls', replaceWith: 'ph-file-xls' },
  { replace: 'po-icon-document', replaceWith: 'ph-file' },
  { replace: 'po-icon-document-double', replaceWith: 'ph-files' },
  { replace: 'po-icon-document-filled', replaceWith: 'ph-file-text' },
  { replace: 'po-icon-download', replaceWith: 'ph-download-simple' },
  { replace: 'po-icon-edit', replaceWith: 'ph-pencil-simple' },
  { replace: 'po-icon-exam', replaceWith: 'ph-flask' },
  { replace: 'po-icon-exclamation', replaceWith: 'ph-warning-circle' },
  { replace: 'po-icon-exit', replaceWith: 'ph-sign-out' },
  { replace: 'po-icon-export', replaceWith: 'ph-arrow-square-out' },
  { replace: 'po-icon-eye', replaceWith: 'ph-eye' },
  { replace: 'po-icon-eye-off', replaceWith: 'ph-eye-closed' },
  { replace: 'po-icon-filter', replaceWith: 'ph-funnel' },
  { replace: 'po-icon-finance', replaceWith: 'ph-currency-circle-dollar' },
  { replace: 'po-icon-finance-bitcoin', replaceWith: 'ph-currency-btc' },
  { replace: 'po-icon-finance-secure', replaceWith: 'ph-currency-dollar-simple' },
  { replace: 'po-icon-first-page', replaceWith: 'ph-caret-double-left' },
  { replace: 'po-icon-folder', replaceWith: 'ph-folder' },
  { replace: 'po-icon-food', replaceWith: 'ph-fork-knife' },
  { replace: 'po-icon-food-menu', replaceWith: 'ph-fork-knife' },
  { replace: 'po-icon-gas', replaceWith: 'ph-gas-pump' },
  { replace: 'po-icon-gift', replaceWith: 'ph-gift' },
  { replace: 'po-icon-grid', replaceWith: 'ph-squares-four' },
  { replace: 'po-icon-handshake', replaceWith: 'ph-handshake' },
  { replace: 'po-icon-hdd', replaceWith: 'ph-hard-drive-disk' },
  { replace: 'po-icon-help', replaceWith: 'ph-question' },
  { replace: 'po-icon-history', replaceWith: 'ph-clock-counter-clockwise' },
  { replace: 'po-icon-home', replaceWith: 'ph-house-line' },
  { replace: 'po-icon-image-align-inline', replaceWith: 'ph-image-align-inline' },
  { replace: 'po-icon-image-align-left', replaceWith: 'ph-image-align-left' },
  { replace: 'po-icon-image-align-right', replaceWith: 'ph-image-align-right' },
  { replace: 'po-icon-info', replaceWith: 'ph-info' },
  { replace: 'po-icon-injector', replaceWith: 'ph-syringe' },
  { replace: 'po-icon-keyboard', replaceWith: 'ph-keyboard' },
  { replace: 'po-icon-last-page', replaceWith: 'ph-caret-double-right' },
  { replace: 'po-icon-layers', replaceWith: 'ph-stack-simple' },
  { replace: 'po-icon-light', replaceWith: 'ph-lightbulb' },
  { replace: 'po-icon-like', replaceWith: 'ph-heart' },
  { replace: 'po-icon-link', replaceWith: 'ph-link' },
  { replace: 'po-icon-list', replaceWith: 'ph-list-bullets' },
  { replace: 'po-icon-lock', replaceWith: 'ph-lock' },
  { replace: 'po-icon-lock-off', replaceWith: 'ph-lock-open' },
  { replace: 'po-icon-mail', replaceWith: 'ph-envelope' },
  { replace: 'po-icon-manufacture', replaceWith: 'ph-factory' },
  { replace: 'po-icon-map', replaceWith: 'ph-map-trifold' },
  { replace: 'po-icon-menu', replaceWith: 'ph-list' },
  { replace: 'po-icon-menu-close', replaceWith: 'ph-menu-close' },
  { replace: 'po-icon-menu-open', replaceWith: 'ph-menu-open' },
  { replace: 'po-icon-message', replaceWith: 'ph-chat' },
  { replace: 'po-icon-microphone', replaceWith: 'ph-microphone' },
  { replace: 'po-icon-minus', replaceWith: 'ph-minus' },
  { replace: 'po-icon-minus-circle', replaceWith: 'ph-minus-circle' },
  { replace: 'po-icon-money', replaceWith: 'ph-money' },
  { replace: 'po-icon-more', replaceWith: 'ph-dots-three' },
  { replace: 'po-icon-more-vert', replaceWith: 'ph-dots-three-vertical' },
  { replace: 'po-icon-news', replaceWith: 'ph-newspaper' },
  { replace: 'po-icon-no-signal', replaceWith: 'ph-cloud-slash' },
  { replace: 'po-icon-notification', replaceWith: 'ph-bell' },
  { replace: 'po-icon-oil', replaceWith: 'ph-drop' },
  { replace: 'po-icon-oil-analysis', replaceWith: 'ph-oil-magnifying-glass' },
  { replace: 'po-icon-ok', replaceWith: 'ph-check' },
  { replace: 'po-icon-pallet-full', replaceWith: 'ph-pallet-full' },
  { replace: 'po-icon-pallet-partial', replaceWith: 'ph-pallet-partial' },
  { replace: 'po-icon-parameters', replaceWith: 'ph-sliders-horizontal' },
  { replace: 'po-icon-paste', replaceWith: 'ph-selection-foreground' },
  { replace: 'po-icon-payment', replaceWith: 'ph-hand-coins' },
  { replace: 'po-icon-pdf', replaceWith: 'ph-file-pdf' },
  { replace: 'po-icon-picker', replaceWith: 'ph-eyedropper' },
  { replace: 'po-icon-picture', replaceWith: 'ph-image' },
  { replace: 'po-icon-pin', replaceWith: 'ph-map-pin' },
  { replace: 'po-icon-pix-logo', replaceWith: 'ph-pix-logo' },
  { replace: 'po-icon-plus', replaceWith: 'ph-plus' },
  { replace: 'po-icon-plus-circle', replaceWith: 'ph-circle' },
  { replace: 'po-icon-print', replaceWith: 'ph-printer' },
  { replace: 'po-icon-pushcart', replaceWith: 'ph-shopping-cart-simple' },
  { replace: 'po-icon-qr-code', replaceWith: 'ph-qr-code' },
  { replace: 'po-icon-refresh', replaceWith: 'ph-arrows-clockwise' },
  { replace: 'po-icon-sale', replaceWith: 'ph-newspaper-clipping' },
  { replace: 'po-icon-screen-full', replaceWith: 'ph-corners-out' },
  { replace: 'po-icon-screen-minimize', replaceWith: 'ph-corners-in' },
  { replace: 'po-icon-search', replaceWith: 'ph-magnifying-glass' },
  { replace: 'po-icon-security-guard', replaceWith: 'ph-shield-check' },
  { replace: 'po-icon-server', replaceWith: 'ph-server' },
  { replace: 'po-icon-settings', replaceWith: 'ph-gear' },
  { replace: 'po-icon-share', replaceWith: 'ph-share' },
  { replace: 'po-icon-signal', replaceWith: 'ph-radio-signal' },
  { replace: 'po-icon-sms', replaceWith: 'ph-chat-dots' },
  { replace: 'po-icon-social-github', replaceWith: 'ph-github-logo' },
  { replace: 'po-icon-social-instagram', replaceWith: 'ph-instagram-logo' },
  { replace: 'po-icon-social-twitter', replaceWith: 'ph-x-logo' },
  { replace: 'po-icon-social-whatsapp', replaceWith: 'ph-whatsapp-logo' },
  { replace: 'po-icon-sort', replaceWith: 'ph-arrows-down-up' },
  { replace: 'po-icon-sort-asc', replaceWith: 'ph-arrow-down' },
  { replace: 'po-icon-sort-ascending', replaceWith: 'ph-sort-ascending' },
  { replace: 'po-icon-sort-desc', replaceWith: 'ph-arrow-up' },
  { replace: 'po-icon-sort-descending', replaceWith: 'ph-sort-descending' },
  { replace: 'po-icon-star', replaceWith: 'ph-star' },
  { replace: 'po-icon-star-filled', replaceWith: 'ph-fill ph-star', fill: true },
  { replace: 'po-icon-star-half', replaceWith: 'ph-fill ph-star-half', fill: true },
  { replace: 'po-icon-steering-wheel', replaceWith: 'ph-steering-wheel' },
  { replace: 'po-icon-stock', replaceWith: 'ph-package' },
  { replace: 'po-icon-table', replaceWith: 'ph-desk' },
  { replace: 'po-icon-target', replaceWith: 'ph-target' },
  { replace: 'po-icon-telephone', replaceWith: 'ph-phone' },
  { replace: 'po-icon-text-bold', replaceWith: 'ph-text-b' },
  { replace: 'po-icon-text-italic', replaceWith: 'ph-text-italic' },
  { replace: 'po-icon-text-underline', replaceWith: 'ph-text-underline' },
  { replace: 'po-icon-touch', replaceWith: 'ph-hand-tap' },
  { replace: 'po-icon-travel', replaceWith: 'ph-suitcase-rolling' },
  { replace: 'po-icon-truck', replaceWith: 'ph-truck' },
  { replace: 'po-icon-upload', replaceWith: 'ph-upload-simple' },
  { replace: 'po-icon-upload-cloud', replaceWith: 'ph-cloud-arrow-up' },
  { replace: 'po-icon-user', replaceWith: 'ph-user' },
  { replace: 'po-icon-user-add', replaceWith: 'ph-user-plus' },
  { replace: 'po-icon-user-delete', replaceWith: 'ph-user-x' },
  { replace: 'po-icon-users', replaceWith: 'ph-users' },
  { replace: 'po-icon-video-call', replaceWith: 'ph-video-camera' },
  { replace: 'po-icon-waiter', replaceWith: 'ph-waiter' },
  { replace: 'po-icon-wallet', replaceWith: 'ph-wallet' },
  { replace: 'po-icon-warehouse', replaceWith: 'ph-warehouse' },
  { replace: 'po-icon-warning', replaceWith: 'ph-warning-circle' },
  { replace: 'po-icon-weight', replaceWith: 'ph-weight' },
  { replace: 'po-icon-world', replaceWith: 'ph-globe' },
  { replace: 'po-icon-xml', replaceWith: 'ph-file-xml' },
  { replace: 'po-icon-zoom-in', replaceWith: 'ph-magnifying-glass-plus' },
  { replace: 'po-icon-zoom-out', replaceWith: 'ph-magnifying-glass-minus' }
];

export interface ReplaceChanges {
  replace: string | RegExp;
  replaceWith: string | Function;
  fill?: boolean;
}

export const updateDepedenciesVersion: UpdateDependencies = {
  dependencies: [
    '@po-ui/ng-components',
    '@po-ui/ng-code-editor',
    '@po-ui/ng-templates',
    '@po-ui/ng-storage',
    '@po-ui/ng-sync',
    '@po-ui/style'
  ]
};

export const poIconInsideReplaces: Array<ReplaceChanges> = [{ replace: regexRemovePoIconInside, replaceWith: '' }];

export const poIconReplaces: Array<ReplaceChanges> = [{ replace: regexRemovePoIcon, replaceWith: '' }];
